<template>
	<view class="addressBook" :class='APPTheme'>
		<uni-nav-bar fixed status-bar left-icon="back"  title="文件夹属性" :color="APPTheme=='theme-light'?'#000000':'#ffffff'" :background-color="APPTheme=='theme-light'?'#ffffff':'#000000'" @clickLeft="$lizhao.lznavigate.lzNavigateBack()"></uni-nav-bar>
		<u-cell-group class="theme-bg" :border="false">
			<u-cell-item title="谁可以管理" hover-class="theme-bg-active" :value="administration+'人'" title-width="600" @click="navigetTo(0)"></u-cell-item>
			<u-cell-item title="谁可以编辑/上传" hover-class="theme-bg-active" :value="editUpload+'人'" title-width="600" @click="navigetTo(1)"></u-cell-item>
			<u-cell-item title="谁可以查看" hover-class="theme-bg-active" :value="seeLength+'人'" title-width="600" @click="navigetTo(2)"></u-cell-item>
		</u-cell-group>
		<view class="mask" @click="permissionDes">权限说明</view>
		<!-- <u-empty mode="message"></u-empty> -->
		<u-no-network></u-no-network>
	</view>
</template>

<script>
	let that
	import {
		mapGetters,
		mapActions
	} from 'vuex'
	export default {
		computed: {
			...mapGetters(['APPTheme', 'userInfo', 'api']),
		},
		components: {},
		data() {
			return {
				transmission:null,//传过来的值
				administration:0,//谁可以管理人数
				editUpload:0,//谁可以编辑/上传人数
				seeLength:0,//谁可以查看人数
			}
		},
		onLoad(e) {
			that = this
			that.transmission = JSON.parse(e.option)
			console.log(that.transmission);
		},
		onShow() {
			//设置主题颜色
			that.GLOBAL.setThemeColor(that.APPTheme)
			//获取文件夹权限人数
			that.filingCabinetsRole_getSize()
		},
		onTabItemTap(e) {
			//设置主题颜色
			that.GLOBAL.setThemeColor(that.APPTheme)
		},
		methods: {
			//跳转
			navigetTo(roleType){
				//需要设置的权限 0谁可以管理，1谁可以编辑上传，2谁可以查看
				uni.navigateTo({url: '/pages/document/folderPropertieSub/folderPropertieSub?option='+JSON.stringify(that.transmission)+'&roleType='+roleType});
			},
			//获取文件夹权限人数
			filingCabinetsRole_getSize(){
				let req={
					filingId:that.transmission.id,//文件柜id
				}
				that.GLOBAL.doGet(that.api.GLOBAL_admin_rest_biz_filingCabinetsRole_getSize,req).then(res=>{
					if(res.code=='0'&&res.data){
						that.administration=res.data.administration
						that.editUpload=res.data.editUpload
						that.seeLength=res.data.seeLength
					}
				})
			},
			//权限说明
			permissionDes(){
				uni.previewImage({
					urls: ['../../../static/image/doc/quanxian.png'],
				});
			},
			
			
		}

	}
</script>

<style scoped lang="scss">
	.addressBook {
		height: 100%;
		.theme-bg{
			margin-bottom: 10px;
		}
		.mask{color: #888;font-size: 14px;margin-left: 10px;}
	}
</style>
